home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 358 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: solon.com!not-for-mail
  2. From: encom@jolt.mpx.com.au (Encom Technology Sydney)
  3. Newsgroups: comp.std.c,comp.lang.c.moderated
  4. Subject: Re: Integral promotion.
  5. Followup-To: comp.std.c,comp.lang.c.moderated
  6. Date: 22 Feb 1996 21:42:40 -0600
  7. Organization: Microplex Pty Ltd
  8. Sender: clc@solutions.solon.com
  9. Approved: clc@solutions.solon.com
  10. Message-ID: <4gjd3g$nt9@solutions.solon.com>
  11. References: <4fstj7$2l6@solutions.solon.com> <4fvgvb$e0t@solutions.solon.com> <4gfgfp$3k8@solutions.solon.com>
  12. NNTP-Posting-Host: solutions.solon.com
  13. X-Newsreader: TIN [version 1.2 PL2]
  14.  
  15. Re: short = short + short causing a warning.
  16.  
  17. This is all getting off the track.  Since only a warning is generated this
  18. has very little to do with the standard.  I think the point is why does
  19.  
  20. short = short + short;
  21.  
  22. generate a warning whereas
  23.  
  24. int = int + int;
  25.  
  26. does not.  Both these statements are as prone to overflow as each other
  27. (although in the first case it may not happen until the int resulting
  28. from the addition is moved into the short if sizeof(int) > sizeof(short).
  29.  
  30. The warning is even sillier since on the implementation mentioned
  31. ints and shorts are the same.
  32.